package main

import (
	"fmt"
	"log"
)

func ImportToml(pathname string) {
	cfg := readConf(pathname)
	id, err := CreateFlow(cfg.Title)
	if err != nil {
		panic(err)
	}
	log.Printf("Flow ID: %d\n", id)
	tblName := fmt.Sprintf("flow%d", id)
	for k, v := range cfg.Nodes {
		err := InsertNode2(tblName, k, v.Id, v.Status, v.Depend)
		if err != nil {
			panic(err)
		}
	}
}
